home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1996 #15
/
Monster Media Number 15 (Monster Media)(July 1996).ISO
/
prog_d
/
startmup.zip
/
STARTMUP.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1996-04-07
|
2KB
|
108 lines
unit StartMup;
interface
uses
SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
Forms, Dialogs, MMsystem, DsgnIntf, TypInfo;
type
TStartMeUpEditor = class(TComponentEditor)
function GetVerbCount: Integer; Override;
function GetVerb(index: Integer):String; Override;
procedure ExecuteVerb(index: Integer); Override;
procedure Execute;
procedure About;
procedure Help;
end;
TStartMeUp = class(TComponent)
public
procedure Execute;
end;
procedure Register;
implementation
{$R STARTMUP.RES }
procedure StartItUp;
var
FindRes:THandle;
LoadRes:THandle;
LockPtr:PChar;
begin
FindRes := FindResource(hInstance,'WAVSTARTMEUP','WAVE');
LoadRes := LoadResource(hInstance,FindRes);
LockPtr := PChar(LockResource(LoadRes));
sndPlaySound(LockPtr,SND_MEMORY+SND_SYNC);
UnlockResource(LoadRes);
FreeResource(LoadRes);
end;
procedure TStartMeUp.Execute;
begin
StartItUp;
end;
function TStartMeUpEditor.GetVerbCount: integer;
begin
result := 3;
end;
function TStartMeUpEditor.GetVerb(index: Integer): string;
begin
case index of
0:result := 'E&xecute';
1:result := '&Help..';
2:result := 'About..';
end;
end;
procedure TStartMeUpEditor.ExecuteVerb(index:integer);
begin
case index of
0:execute;
1:help;
2:about;
end;
end;
procedure TStartMeUpEditor.Execute;
begin
StartItUp;
end;
procedure TStartMeUpEditor.About;
const
cr = #13;
begin
MessageDlg('"Start Me Up" Component'+cr+cr+
'Written by Pepijn Smits'+cr+
'CompuServe 74750,733'+cr+cr+
'This Component is Freeware'+cr+cr+
'See STARTMUP.TXT for more information'
,mtInformation,[mbOk],0)
end;
procedure TStartMeUpEditor.Help;
const
cr = #13;
begin
MessageDlg('Help for "Start Me Up" Component'+cr+cr+
'The component has only 1 method: Execute, '+
'that method will sound the first tunes of '+
'"Start Me Up". The sound is stored in a '+
'resource and thus included in the .EXE, so there''s no '+
'need for a separate .WAV file.'
,mtInformation,[mbOk],0)
end;
procedure Register;
begin
RegisterComponents('Samples', [TStartMeUp]);
RegisterComponentEditor(TStartMeUp,TStartMeUpEditor);
end;
end.